x11: Don't handle focus events for NULL windows
authorBenjamin Otte <otte@redhat.com>
Thu, 22 Dec 2011 07:29:47 +0000 (08:29 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 22 Dec 2011 23:15:59 +0000 (00:15 +0100)
The check was accidentally removed in the refactoring of
2ea328dfbc820c32a6f425805e632cd1aef45258.

gdk/x11/gdkdevicemanager-core-x11.c

index 156ba8bfd8c163c12546a475f7822dd8667e2161..9969f4f9d66d05e75fdf5dd8cd631e7f82bcc576 100644 (file)
@@ -664,12 +664,14 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
 
     case FocusIn:
     case FocusOut:
-      _gdk_device_manager_core_handle_focus (window,
-                                             device_manager->core_keyboard,
-                                             NULL,
-                                             xevent->type == FocusIn,
-                                             xevent->xfocus.detail,
-                                             xevent->xfocus.mode);
+      if (window)
+        _gdk_device_manager_core_handle_focus (window,
+                                               device_manager->core_keyboard,
+                                               NULL,
+                                               xevent->type == FocusIn,
+                                               xevent->xfocus.detail,
+                                               xevent->xfocus.mode);
+      return_val = FALSE;
       break;
                                               
     default: